# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Calendar.V3.Model.Colors do
  @moduledoc """


  ## Attributes

  *   `calendar` (*type:* `%{optional(String.t) => GoogleApi.Calendar.V3.Model.ColorDefinition.t}`, *default:* `nil`) - A global palette of calendar colors, mapping from the color ID to its definition. A calendarListEntry resource refers to one of these color IDs in its colorId field. Read-only.
  *   `event` (*type:* `%{optional(String.t) => GoogleApi.Calendar.V3.Model.ColorDefinition.t}`, *default:* `nil`) - A global palette of event colors, mapping from the color ID to its definition. An event resource may refer to one of these color IDs in its colorId field. Read-only.
  *   `kind` (*type:* `String.t`, *default:* `calendar#colors`) - Type of the resource ("calendar#colors").
  *   `updated` (*type:* `DateTime.t`, *default:* `nil`) - Last modification time of the color palette (as a RFC3339 timestamp). Read-only.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :calendar =>
            %{optional(String.t()) => GoogleApi.Calendar.V3.Model.ColorDefinition.t()} | nil,
          :event =>
            %{optional(String.t()) => GoogleApi.Calendar.V3.Model.ColorDefinition.t()} | nil,
          :kind => String.t() | nil,
          :updated => DateTime.t() | nil
        }

  field(:calendar, as: GoogleApi.Calendar.V3.Model.ColorDefinition, type: :map)
  field(:event, as: GoogleApi.Calendar.V3.Model.ColorDefinition, type: :map)
  field(:kind)
  field(:updated, as: DateTime)
end

defimpl Poison.Decoder, for: GoogleApi.Calendar.V3.Model.Colors do
  def decode(value, options) do
    GoogleApi.Calendar.V3.Model.Colors.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Calendar.V3.Model.Colors do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
